﻿namespace Sai.Core
{
	public class ProductReleaseDifferenceFactory : IProductReleaseDifferenceFactory
	{
		private ApplicationVersionStamp avs = new ApplicationVersionStamp();
               
		public ProductReleaseDifferenceFactory(string productName, string fromVersion, string toVersion)
		{
			this.ProductName = productName;
			this.FromVersion = fromVersion;
			this.ToVersion = toVersion;
		}

		public ProductReleaseDifferenceFactory(ProductReleaseProject project)
		{
			this.ProductName = project.Name;
			this.FromVersion = project.FromVersion;
			this.ToVersion = project.ToVersion;
		}

		private string ProductName { get; set; }

		private string FromVersion { get; set; }

		private string ToVersion { get; set; }

		public IProductReleaseDifference Create()
		{
			return new ProductReleaseDifference()
			{
				Name = this.ProductName,
				FromVersion = this.FromVersion,
				ToVersion = this.ToVersion,
                ProductName = this.avs.Name,
				ProductLink = this.avs.Link,
				ProductVersion = this.avs.Version
			};
		}
	}
}
